package com.heima.user.interceptor;

import com.heima.user.util.AppThreadLocalUtil;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

@Component
public class FeignHeaderInterceptor implements RequestInterceptor {

    @Override
    public void apply(RequestTemplate requestTemplate) {
        requestTemplate.header("userId", AppThreadLocalUtil.getUser().getId() + "");
    }
}